namespace LyxWaf.Services.Files;

public class FileProviderOptions
{
    public Dictionary<string, FileEveryConfig> Everys { get; set; } = [];
    public TimeSpan CacheDuration { get; set; } = TimeSpan.FromMinutes(1);
    public string[] AllowedExtensions { get; set; } = [".txt", ".pdf", ".jpg", ".png", ".gif", ".mp4", ".mp3", ".zip"];
    public Dictionary<string, string> MimeExtensions { get; set; } = new Dictionary<string, string> {
        {".txt", "text/plain"},
    };

    public HashSet<string> RemoveExtensions { get; set; } = [];
    public bool EnableRangeProcessing { get; set; } = true;
    public bool EnableCaching { get; set; } = true;
}

public class FileEveryConfig
{
    public string[] Default { get; set; } = ["index.html", "index.htm"];
    public long MaxFileSize { get; set; } = 100 * 1024 * 1024; // 100MB
    public string BasePath { get; set; } = "wwwroot/files";
    public string[]? TryFiles { get; set; } = null;
}